// Interpreter.h
// Define class Interpreter
#ifndef INTERPRETER_H
#define INTERPRETER_H

#include "crossbit/common.h"
#include "crossbit/ProcessorState.h"
#include "crossbit/VBlockBuilder.h"

namespace crossbit {

    class Interpreter {
        public:
            Interpreter( ProcessorState *state )
            {
                interp_state = state;
            }

            virtual ~Interpreter() {}

            // Decode the instruction beginning at "addr", add VInst to
            //   block builder "bb".
            // Return the _SPC_ of next instruction.
            virtual XTMemAddr decode (XTMemAddr addr, VBlockBuilder *bb) = 0;

            // Initialization
            virtual XTInt32 initStack(XTMemAddr sp) = 0;
            ProcessorState* get_state( void ) { return interp_state; }
        protected:

            ProcessorState* interp_state;

    };
}

#endif
